package main;

import java.io.PrintStream;

import org.apache.log4j.Logger;


import ui.flowManager.FlowManagerImpl;

public class Main {

	
	public static String EXPORT_DIR="resultDir";
	private static Logger log = Logger.getLogger(Main.class);
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		//set EXPORT DIR
		System.setProperty(Main.EXPORT_DIR, System.getProperty(Main.EXPORT_DIR)+"\\");
		//SET STD OUT STD ERR to log file
		System.setOut(createLoggingProxy(System.out));
        System.setErr(createLoggingProxy(System.err));
		//start
		log.info("starting the experiment");
		FlowManagerImpl flow=FlowManagerImpl.getInstance();
		flow.start();
	}
	
	public static PrintStream createLoggingProxy(final PrintStream realPrintStream) {
        return new PrintStream(realPrintStream) {
            public void print(final String string) {
                realPrintStream.print(string);
                log.info(string);
            }
        };
    }
	

}
